﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;

namespace CenterDateAchieve.Test
{

    public class PrintManager
    {
        public PrintManager()
        {
            work_ = new Thread(new ThreadStart(Execute));
        }
        private Thread work_;
        private bool isRun_ = true;
        public void OnStart()
        {
            work_.Start();
            Console.WriteLine("work_.start()");
        }
        public void OnStop()
        {
            isRun_ = false;
            work_.Join();
            Console.WriteLine("work_.stop()");
        }
        public void Execute()
        {
            while(isRun_)
            {
                Console.WriteLine("DateTime:{0}", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss fff"));
                //Thread.Sleep(100);

            }
        }
    }
}
